Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch item class for each row of the data #231

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

raviks789
Copy link
Contributor

@raviks789 raviks789 commented Sep 19, 2024

Currently, it is assumed that each list item in the list will be of same instance. Hence, calling getItemClass() method once in the assemble() method was sufficient to obtain the instance of the list item and build the entire list.

But if we want to build a list containing list items of different instances, we would have to obtain the instance for each list item. For instance, the root problem list for dependencies contains host, service or redundancy group. Hence, the list item can be an instance of HostListItem, ServiceListItem or RedundancyGroupListItem.

In which case, it would require us to rewrite parent assemble() method, which is not desirable. To avoid this createListItem() method must be introduced, that will be responsible for creating the list item.

src/Common/BaseItemList.php Outdated Show resolved Hide resolved
src/Common/BaseItemList.php Outdated Show resolved Hide resolved
@raviks789 raviks789 force-pushed the fetch-item-class-based-on-row branch 2 times, most recently from b681739 to df5da6e Compare September 19, 2024 14:27
@nilmerg nilmerg added the enhancement New feature or request label Sep 24, 2024
@nilmerg nilmerg modified the milestones: v0.10.1, v0.11.0 Sep 24, 2024
@nilmerg nilmerg merged commit 09afc04 into main Sep 24, 2024
22 checks passed
@nilmerg nilmerg deleted the fetch-item-class-based-on-row branch September 24, 2024 12:39
nilmerg added a commit to Icinga/icingadb-web that referenced this pull request Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla/signed enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants